package com.bizark.rpc.api.share_serv.system.system.service;

import com.bizark.rpc.common.tool.DateUtils;
import com.bizark.rpc.common.tool.GsonUtil;
import com.bizark.rpc.common.tool.SysToolHelper;
import com.bizark.rpc.common.tool.SystemInfoUtil;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by tsj on 2017/3/7.
 */
public class SystemServiceImpl implements SystemService {
    @Override
    public String info() {
        Map map = new HashMap();
        map.put("datetime", DateUtils.getDate(new Date()));
        Map<String, Object> hostInfo = SystemInfoUtil.getHostInfo();
        map.put("hostname", SysToolHelper.getMapValue(hostInfo, "hostName"));
        String res = GsonUtil.getJsonForObject(map);
        return res;
    }
}
